#ifndef _BARREL_SWITCH_H
#define _BARREL_SWITCH_H

#include "base_drv/rc.h"
#include HAL_INCLUDE
#include "base_drv/drv_conf.h"

extern CAN_HandleTypeDef hcan2;
#define SWITCH_MOTORS_HCAN hcan2

#define SWITCH_MOVE 0
#define SWITCH_STOP 1
#define SET_SWITCH_SPEED 2000
#define SWITCH_STUCK_SPEED 200
#define SWITCH_STUCK_CURENT 2500
#define SWITCH_STUCK_MAX_TIME_CNT 5//XXXXXXXX

void barrel_switch_init(void);
void barrel_switch_control_loop(rc_ctrl_t* rc_recv);

extern uint8_t switch_work_flag, enable_auto_switch;
extern int8_t switch_direction;

#endif
